<template>
  <div class="app">
    <img style="margin:200px auto 0px auto;" src="../../public/img01/logo.png"  >
    <h2 >Pet of heart</h2>
    <el-card style="width: 600px;height: 300px; background-color: rgba(255,255,255,0.3);margin: 0 auto">
      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="70px" class="demo-ruleForm">
        <el-form-item label="用户名" prop="username">
          <el-input v-model="ruleForm.username"></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="password">
          <el-input v-model="ruleForm.password"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="submitForm('ruleForm')"style="margin-right: 70px">登录</el-button>
        </el-form-item>
      </el-form>
    </el-card>
    </div>
</template>
  <script>
    export default {
      data() {
        return {
          ruleForm: {
            username: 'root',
            password: '123456'
          },
          rules: {
            username: [
              {required: true, message: '请输入用户名', trigger: 'blur'},
              {min: 4, max: 15, message: '长度在 4 到 15 个字符', trigger: 'blur'}
            ],
            password: [
              {required: true, message: '请输入密码', trigger: 'blur'},
              {min: 4, max: 15, message: '长度在 4 到 15 个字符', trigger: 'blur'}
            ]
          }
        };
      }
    }
  </script>

  <style>
    body{
      background-image: url("../../public/img01/background.jpg");
      background-size: cover;
      background-repeat: no-repeat;
      text-align: center;
    }
    img{width: 100px}
    h2{
      font-size: 32px;color:#fd5f00;margin: 0 auto;
    }

    .demo-ruleForm{
      width:400px;
      margin: 50px auto;
    }

  </style>

